import fetch from 'utils/fetch';

//查询订单
export function orderAll(orderFormData) {
  return fetch({
		url:  '/api/admin/merchant/findOrder',
    method: 'post',
    headers: {'Content-type': 'application/json;charset=UTF-8'},
    data:orderFormData
  });
}

//商户查询订单
export function merchantOrderAll(orderFormData) {
  return fetch({
	url:  '/api/admin/merchant/MercOrder',
    method: 'post',
    headers: {'Content-type': 'application/json;charset=UTF-8'},
    data:orderFormData
  });
}

//分页
export function orderPage(orderFormData) {
  return fetch({
		url:  '/api/admin/query/findOrder',
    method: 'post',
    headers: {'Content-type': 'application/json;charset=UTF-8'},
    params:orderFormData
  });
}

//订单修正
export function orderCorrect(orderId) {
  return fetch({
		url:  'api/order/order/checkOrder/' + orderId,
    method: 'get',
  });
}

//查询代理商
export function getDistributors(data) {
  return fetch({
		url:  '/api/admin/distributor/getRoleFindDistributor',
    method: 'post',
    data
  });
}

//退款
export function wxRefund(data) {
  return fetch({
		url:  'api/admin/payGateway/wxRefund',
    method: 'post',
    data
  });
}

//查询退款金额
export function wxRefundFindOrder(outTradeNo) {
  return fetch({
		url:  'api/admin/payGateway/wxRefundFindOrder/'+outTradeNo,
    method: 'get',
  });
}

//查询退款金额
export function exportExcel(data) {
    return fetch({
      url:  'api/admin/merchant/download',
      method: 'post',
      responseType: 'blob',
      data
    });
}